<% if flash[:notice]  -%>
  <div class="sysmsg"><%= flash[:notice] -%></div>
  <% flash[:notice] = nil -%>
<% end -%>

<div id="body" class="ui-roundedbox">
  <div class="ui-roundedbox-corner ui-roundedbox-tl">
    <div class="ui-roundedbox-corner ui-roundedbox-tr">
      <div class="ui-roundedbox-corner ui-roundedbox-bl">
        <div class="ui-roundedbox-corner ui-roundedbox-br">
          <div class="ui-roundedbox-content">
            <% if @user.privacy == 'T' -%>
              <%
                # Implement Privacy control later.
              -%>
            <% else -%>
            <div id="info">
              <div id="avatar">
                <%= link_to(image_tag(@user.avatar, :alt => @user.display_name).to_s, {:controller => :message, :action => "user", :id => @user.id} ) -%>
              </div>
              <div id="latest">
                <h1><%= link_to(@user.name, {:controller => :message, :action => "user", :id => @user.id} ) -%></h1>
                <h2><%= @message.content -%>
                <span class="stamp"><%= link_to("Posted about " + time_string(Time.now.to_i - @message.post_at.to_i) + " ago", {:controller => :message, :action => "show", :id => @message.id}, :class => "time") -%></span>
                <span class="op">
                <% if session[:user_name] != nil and session[:user_name] != @user.name-%>
                  <%= link_to("Add to favorite", {:controller => :favorite, :action => "add", :id => @message.id}, :class => "post_act share") -%>
                <% end -%>
                <% if session[:user_name] == @user.name  -%>
                    <% session[:ori_uri] = request.request_uri -%>
                    <%= link_to("Delete", {:controller => :message, :action => "delete", :id => @message.id}, :class => "delete", :confirm => "Do you really want to delete this message?") -%>
                <% end -%>
                </span>
                </h2>
              </div>
            </div>
            <% end -%>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>